<?php


namespace app\api\validate;


use think\Validate;

class UserAddressValidate extends Validate
{

    protected $rule =   [
        'id'            => 'require|number',
        'username'      => 'require',
        'mobile'        => 'require|mobile',
        'province'      => 'require',
        'city'          => 'require',
        'county'        => 'require',
        'detailed'      => 'require',
    ];

    protected $message  =   [
        'id.require'            => '收货地址ID不能为空',
        'id.number'             => '收货地址ID必须为数字',
        'username.require'      => '姓名不能为空',
        'mobile.require'        => '手机号不能为空',
        'mobile.mobile'         => '手机号码不正确',
        'province.require'      => '区域不能为空',
        'city.require'          => '区域不能为空',
        'county.require'        => '区域不能为空',
        'detailed.require'      => '区域不能为空'
    ];

    protected $scene = [
        'id'         => ['id'],
        'add_user_address'     => ['username','mobile','province','city','county','detailed'],
        'edit_user_address'    => ['id','username','mobile','province','city','county','detailed'],
    ];

}